package io.github.junxworks.qt.modules.bi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import io.github.junxworks.qt.modules.bi.mapper.MainMapper;
import io.github.junxworks.qt.modules.bi.service.MainService;
import io.github.junxworks.qt.modules.bi.vo.TradeDateStat;
import io.github.junxworks.qt.modules.data.service.HistoryService;

@Service
public class MainServiceImpl implements MainService {
	@Autowired
	private HistoryService historyService;

	@Autowired
	private MainMapper mainMapper;

	@Override
	public List<TradeDateStat> statChangeDaily(int range, String market) {
		String beginDate = historyService.getTransDate(range);
		return mainMapper.statChangesDaily(beginDate, market);
	}
}
